package com.zdp.es;

import com.sun.tracing.ProbeName;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author ZhengDp
 * @Date 2023/7/22 16:07
 */
@SpringBootApplication
public class EsRestClientDemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(EsRestClientDemoApplication.class,args);
    }


    @Bean
    public RestHighLevelClient restHighLevelClient() {
        // todo 修改，服务器到期了
        return new RestHighLevelClient(RestClient.builder(HttpHost.create("http://110.41.5.4:9200")));
    }
}
